{extend name="PublicBase/showBase" /}

{block name="body"}
<div class="main">
    <div class="row">
        <div class="col-md-12">
            <section class="tile color transparent-black">
                <div class="tile-header bg-transparent-black-2">
                    <h1>
                        {if condition="$Info eq ''"}
                            {:lang('SpPzXz')}
                        {else /}
                            {:lang('SpPzGx')}
                        {/if}
                    </h1>
                    <div class="controls">
                        <a href="javascript:void(0);" onclick="window.history.back();"><i class="fa fa-arrow-left"></i></a>
                        {if condition="$Info eq ''"}
                            <a href="{:url('MallConfs/showAdd')}"><i class="fa fa-refresh"></i></a>
                        {else /}
                            <a href="{:url('MallConfs/showEdit', array('id'=>$Info['confs_id']))}"><i class="fa fa-refresh"></i></a>
                        {/if}
                    </div>
                </div>
                <div class="tile-body nopadding">
                    <form class="FormTable" action="" method="post">
                        <div class="tile-body">
                            <div class="row">
                                <div class="form-group col-sm-12">
                                    <label>{:lang('SpPzFz')}</label>
                                    <select class="chosen-select chosen-transparent form-control" name="confs_group">
                                        {volist name="Group" id="vo"}
                                            <option value="{$vo.content_value}" {eq name="Info['confs_group']" value="$vo['content_value']"}selected{/eq}>{$vo.content_name}</option>
                                        {/volist}
                                    </select>
                                </div>
                                <div class="form-group col-sm-12">
                                    <label>{:lang('SpPzBs')}</label>
                                    <input type="text" class="form-control required" name="confs_name" value="{$Info.confs_name}" placeholder="{:lang('SpPzBsWk')}{:lang('SpPzBsAl')}">
                                </div>
                                <div class="form-group col-sm-12">
                                    <label>{:lang('SpPzMc')}</label>
                                    <input type="text" class="form-control required" name="confs_title" value="{$Info.confs_title}" placeholder="{:lang('SpPzMcWk')}">
                                </div>
                                <div class="form-group col-sm-12">
                                    <label>{:lang('SpPzLx')}</label>
                                    <select class="chosen-select chosen-transparent form-control" name="confs_type" id="confs_type">
                                        <option value="1" {eq name="Info['confs_type']" value="1"}selected{/eq}>{:lang('SpPzLx1')}</option>
                                        <option value="2" {eq name="Info['confs_type']" value="2"}selected{/eq}>{:lang('SpPzLx2')}</option>
                                    </select>
                                </div>
                                <div class="form-group col-sm-12" id="div_input">
                                    <label>{:lang('SpPzNr')}</label>
                                    <input type="text" class="form-control" name="confs_value" value="{$Info.confs_value}" placeholder="{:lang('SpPzNrWk')}">
                                </div>
                                <div class="form-group col-sm-12" id="div_select" style="display:none">
                                    <label>{:lang('SpPzXl')}</label>
                                    <input type="text" class="form-control" name="confs_select" value="{$Info.confs_select}" placeholder="{:lang('SpPzXlWk')}{:lang('SpPzXlAl')}">
                                </div>
                                <div class="form-group col-sm-12">
                                    <label>{:lang('SpPzSm')}</label>
                                    <input type="text" class="form-control" name="confs_remark" value="{$Info.confs_remark}" placeholder="{:lang('SpPzSmWk')}">
                                </div>
                                <div class="form-group col-sm-12">
                                    <label>{:lang('SpPzXs')}</label>
                                    <select class="chosen-select chosen-transparent form-control" name="confs_show">
                                        <option value="2" {eq name="Info['confs_show']" value="2"}selected{/eq}>{:lang('SpPzXs2')}</option>
                                        <option value="1" {eq name="Info['confs_show']" value="1"}selected{/eq}>{:lang('SpPzXs1')}</option>
                                    </select>
                                </div>
                                <div class="form-group col-sm-12">
                                    <label>{:lang('SpPzPx')}</label>
                                    <input type="text" class="form-control" name="confs_sort" value="{$Info.confs_sort|default=0}" placeholder="{:lang('SpPzPxWk')}{:lang('SpPzPxAl')}">
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="tile-footer bg-transparent-black-2 rounded-bottom-corners">
                    <div class="row">
                        <div class="col-sm-12 text-center">
                            <button type="button" class="btn btn-{:config('CNF_BTNCOLOR')} ajax-post">{:lang('XtAnTj')}</button>
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </div>
</div>
{/block}

{block name="script"}
    <script>
        $(function(){
            {if condition="$Info['confs_type'] eq 1"}
                $('#div_input').show();
                $('#div_select').hide();
            {elseif condition="$Info['confs_type'] eq 2" /}
                $('#div_input,#div_select').show();
            {/if}

            $('#confs_type').change(function(){
                var confs_type = $('#confs_type').val();
                if(confs_type == 1){
                    $('#div_input').show();
                    $('#div_select').hide();
                }else if(confs_type == 2){
                    $('#div_input,#div_select').show();
                }
            });
        })
    </script>
{/block}
      
